const College = require("../models/college");
const sequelize = require("../config/sequelize");
const { changekeyWord } = require("../utils/changeKeyword");
const { Op } = require("sequelize");

//获取大学数据
exports.list = async function(keyWord = '', page = 1, size = 20){
    const searchKey = changekeyWord(keyWord)
    return College.findAndCountAll({
        where:{
            college:{
                [Op.regexp]: searchKey
            }
        },
        limit: Number(size),
        offset: (Number(page) - 1) * size,
    });
}

